montecarlo
Class Main

java.lang.Object
  extended by montecarlo.Main

public class Main
extends java.lang.Object

Program control for replicating the Monte Carlo experiments in Bajari, Hong, and Ryan (2009). The program makes use of a Gridgain computing grid if available; see www.gridgain.com.

The program works in a few simple steps:

  1. Initialize the graphical user interface (GUI).
  2. Initialize an ExecutorService using either Gridgain or a fixed thread pool.
  3. Pass MonteCarloTask objects to the ExecutorService for evaluation.
  4. Collect and report the results.
  5. Repeat as desired for different numbers of observations, importance games, etc.

The results are reported in a GUI, and consist of three sets of numbers (means, medians, standard deviations, mean bias, median bias, mean absolute deviations, and median absolute deviations):

  1. Results using the identity matrix as weights in the GMM objective function.
  2. Results using the optimal weighting matrix calculated using the results from the first step.
  3. Summary statistics for the standard deviations of each LTE chain used in each replication of the Monte Carlo.

The primary numbers reported in the paper are drawn from the second set of results. The first set is reported for completeness, as they are used to construct the second set of results. The third set of results is reported as a consistency check on the second set of results. For large enough MCMC chain sizes, the mean of the standard deviations of the LTE chains should be equal to the standard deviations reported in the second set of results. These were calculated for diagnostic purposes, and are not used in the paper, but are kept here for completeness. We use the LTE method from Chernozhukov and Hong (2003) for optimizing each run in the Monte Carlo. The appendix of their paper contains an overview of the algorithm. Newton-based methods are also included and may be used by changing the code in MonteCarloTask.

An overview of the concurrency architecture in Java can be found at java.sun.com.


Field Summary
static java.text.NumberFormat nf
          Instance of the localized number formatting utility class.
static int NUM_THREADS
          Number of threads to use if not using a Gridgain grid.
static int numParams
          Number of parameters.
static int numRuns
          Number of Monte Carlo runs to perform.
static double[] trueX
          The true values of the primitives.
static boolean useGrid
          Boolean indicating whether or not the program should attempt to utilize a Gridgain-based ExecutorService when submitting tasks
 
Constructor Summary
Main()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static void outputResults(Jama.Matrix x, javax.swing.JTextArea jt, int numParams)
          A simple utility method for reporting summary statistics from a passed Jama.Matrix object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nf

public static java.text.NumberFormat nf
Instance of the localized number formatting utility class.


trueX

public static double[] trueX
The true values of the primitives.


numParams

public static int numParams
Number of parameters.


numRuns

public static int numRuns
Number of Monte Carlo runs to perform.


NUM_THREADS

public static int NUM_THREADS
Number of threads to use if not using a Gridgain grid.


useGrid

public static boolean useGrid
Boolean indicating whether or not the program should attempt to utilize a Gridgain-based ExecutorService when submitting tasks

Constructor Detail

Main

public Main()
Method Detail

main

public static void main(java.lang.String[] args)
Parameters:
args - the command line arguments

outputResults

public static void outputResults(Jama.Matrix x,
                                 javax.swing.JTextArea jt,
                                 int numParams)
A simple utility method for reporting summary statistics from a passed Jama.Matrix object.

Parameters:
x - The matrix containing the data to be summarized.
jt - The JTextArea where the resulting information should be sent.
numParams - The number of parameters to be evaluated.